<template>
  <div class="date-picker">
    <div class="date-controls">
      <button @click="prevDay"><</button>
      <div class="current-date" @click="toggleCalendar">
        {{ formattedDate }}
      </div>
      <button @click="nextDay">></button>
    </div>
    
    <div v-if="showCalendar" class="calendar">
      <!-- Calendar implementation will go here -->
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      currentDate: new Date(),
      showCalendar: false
    }
  },
  computed: {
    formattedDate() {
      const year = this.currentDate.getFullYear()
      const month = String(this.currentDate.getMonth() + 1).padStart(2, '0')
      const day = String(this.currentDate.getDate()).padStart(2, '0')
      return `${year}-${month}-${day}`
    }
  },
  methods: {
    prevDay() {
      const newDate = new Date(this.currentDate)
      newDate.setDate(newDate.getDate() - 1)
      this.currentDate = newDate
    },
    nextDay() {
      const newDate = new Date(this.currentDate)
      newDate.setDate(newDate.getDate() + 1)
      this.currentDate = newDate
    },
    toggleCalendar() {
      this.showCalendar = !this.showCalendar
    }
  }
}
</script>

<style scoped>
.date-picker {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.date-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.current-date {
  cursor: pointer;
  padding: 0 16px;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
}

button:hover {
  background-color: #f0f0f0;
}

.calendar {
  margin-top: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
}
</style>
